package cjh;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Scanner;

import dao.JDBC_SQL;
import dao.JDBC_ConnClose;
import model.StudentVO;
import screen.LoginMain;
import screen.StudentMain;

public class chageUpdate {
	static StudentVO sv = new StudentVO();
	static JDBC_SQL sql = new JDBC_SQL();
	static StringBuilder sb = new StringBuilder();
	static Scanner sc = new Scanner(System.in);
	static Connection conn = null;
	static PreparedStatement pstmt = null;
	static ResultSet rs = null;
	static String add = null;
	static String addv = null;
	static boolean a = false;
	static boolean b = true;
	static String logId = LoginMain.logIdVO;
	
	public static void updateStudent( StudentVO s ) {
			try {
				conn = JDBC_ConnClose.openDataBase();
				pstmt = conn.prepareStatement(sql.StudentUpdateSQL );
				pstmt.setString(1, s.getStd_tr() );
				pstmt.setString(2, s.getStd_no());
				pstmt.setString(3, s.getStd_pw() );
				pstmt.setString(4, s.getStd_name());
				pstmt.setString(5, s.getStd_tel());
				// etc 6,7,8,9
				pstmt.executeUpdate();


			} catch ( Exception e ) {
				e.printStackTrace();
			} finally {
				JDBC_ConnClose.closeDataBase(conn, pstmt, rs);
			}
	}
}